home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / editor / doc6_2.zip / DR6DOC.ASC < prev    next >
Text File  |  1996-05-05  |  66KB  |  1,302 lines

  1.                          SOFTWARE BY SEIDMAN'S 
  2.  
  3.                          DOCTOR 6  Version 2.0
  4.  
  5.                  The File Doctor for WordPerfect(r) 6.0
  6.  
  7.  
  8.                               Introduction
  9.  
  10.  
  11. Things can go wrong with WordPerfect 6 DOS and Windows document files. 
  12. Text may disappear.  WordPerfect 6 (WPerf6) may stop recognizing a file 
  13. as a WPerf6 document file. The program may lock up when you retrieve 
  14. the file.  Windows may throw a GPF.  And other strange things may 
  15. happen. We don't always know why they happen, but we can often do 
  16. something about them when they do. 
  17.  
  18. If your WPerf6 files get sick, Doctor 6, the File Doctor for 
  19. WordPerfect 6, may be able to help. It cannot help if what should be in 
  20. your file has simply vanished from your disk, but that is not what 
  21. usually happens.  Check the size of your file with the DOS DIR command 
  22. or the WPerf file manager.  If the number of bytes is not too small, 
  23. your text is probably still there, and it is time to call the File 
  24. Doctor.  Doctor 6 cannot cure all the maladies that may afflict 
  25. WordPerfect files, but it can cure many of them.  Doctor 6 is 
  26. shareware.  Please register your copy. 
  27.  
  28. Doctor 6 has a number of different ways of diagnosing problems and
  29. operating on files.  One or more of these ways may be necessary to cure
  30. any particular file's problems.  This document explains how to use the
  31. program and how to select among the various ways of curing files. Those
  32. who are familiar with WPMD, the File Doctor for WordPerfect 5, will
  33. recognize some but not all of these methods.  WordPerfect 6 files are
  34. more complicated than WordPerfect 5 files, and the techniques of
  35. surgery are therefore more complicated.  Some files are easily fixed by
  36. use of a single method.  Others require more elaborate approaches.
  37.  
  38. The registered Doctor 6 package includes SaveText, a computer program 
  39. that sometimes helps save text that otherwise might be lost when Doctor 
  40. 6 operates, as well as TestSix, an executable program, and Test6, a 
  41. DLL.  TestSix performs all the diagnostic functions of Doctor 6, and it 
  42. can test large numbers of files at high speed.  Test6 allows you to 
  43. write WordPerfect for Windows macros (or programs in languages that can 
  44. call functions in DLLs) that perform these diagnostic functions. 
  45.  
  46. Doctor 6, SaveText, and TestSix run under MS-DOS (version 2.1 or 
  47. higher) and compatible operating systems.  Doctor 6 requires 
  48. approximately 400K of free memory to operate; the other programs 
  49. require less memory.  Test6 is a Windows 3.1 DLL.  No particular 
  50. installation procedures are required; the programs must merely reside 
  51. in some directory, prefererably on your hard disk. 
  52.  
  53. NOTE:  This product is not manufactured, approved, or supported by 
  54. WordPerfect Corp,, Novell Corp., or Corel Corp.  WordPerfect is a 
  55. registered trademark of one of those three companies. 
  56.  
  57.  
  58.  
  59.                       WordPerfect 6 File Structure
  60.  
  61. To cure the ills of a WordPerfect 6 file, it helps to know a bit about
  62. the structure of a WordPerfect 6 document file.  The file has two main
  63. parts, the "prefix" and the "body."  The prefix, which can be very
  64. large, contains all sorts of miscellaneous information, such as styles,
  65. identification of the PRS file, and proportional spacing tables for
  66. fonts.  It also may contain a good deal of material that in WordPerfect
  67. 5 was part of the body of the document.  For example, the text of
  68. footnotes, endnotes, and text boxes is found in the prefix, not the
  69. body.
  70.  
  71. The body of the document contains everything else.  It helps to think
  72. of the body as containing everything typed in by the user, but this is
  73. not quite correct, because some of what the user types in goes into the
  74. prefix, as indicated above.  The body contains text, formatting codes,
  75. and references to material in the prefix.  Ordinary keyboard
  76. characters, for the most part, appear in the file simply as those
  77. characters (the main exception being the space, which appears as a Ç
  78. when viewed in many other programs).  Everything else is a code, and
  79. its appearance when viewed in another program gives no indication of
  80. what it is.  Codes can be quite complex, and they may include
  81. references to material in the prefix.  Separate the prefix from the
  82. body (as you may do with Doctor 6) and the body is missing much of what
  83. is necessary for a complete document.
  84.  
  85. Any of these elements can go bad.  The structures by which WPerf6 keeps
  86. track of the elements in the prefix can go haywire.  Individual codes
  87. can take on improper values, so that WPerf6 becomes confused.  Body
  88. references to prefix elements can become incorrect (and often will as
  89. you use Doctor 6), leaving WPerf searching for what is not there at
  90. all, or is in an unexpected and unfindable place.  Understanding these
  91. possibilities will help you figure out how best to fix the file.
  92.  
  93.                              Using Doctor 6
  94.  
  95.  
  96. Doctor 6 is a DOS program (although it will run as a DOS program under
  97. Windows).  To run it, type the name of the executable file at the DOS
  98. prompt and press Enter (or use one of the available means of starting
  99. DOS programs under Windows):
  100.  
  101.                             C:\DR6>DOCTOR6
  102.  
  103. The program displays its main menu:
  104.  
  105.  
  106. ╒═══════════════════Software by Seidman's Doctor 6  Ver. 2.0═══════════════════╕
  107. │  File     Diagnose     Operate    Quit (F7, Esc)              Help (F1)      │
  108. │                                                                              │
  109. ╘═════════Copyright 1994-1996 by David Seidman -- All Rights Reserved══════════╛ 
  110.  
  111.  
  112. Select main menu options by typing their first letter or by using the
  113. cursor movement keys to highlight your choice and then hitting enter.
  114.  
  115. Most of what you do will be from the Diagnose and Operate submenus, and
  116. these are described below.  The File submenu is helpful but not
  117. necessary.  Quit has no submenu, and you can use the F7 or Esc keys to
  118. quit the program without using the Quit menu entry.  You can enter Help
  119. either from the menu or by using the F1 key.  Select Help on Help from
  120. the Help submenu for more instructions.  Exit from Help with Esc
  121. (repeated, if necessary).
  122.  
  123.  
  124. I. FILE Submenu
  125.  
  126. Selecting the File menu choice produces the following submenu, from
  127. which you can select with first letters or cursor movement with the
  128. Enter key:
  129.  
  130.                             ╒═════════════╕
  131.                             │ Input File  │
  132.                             │ Output File │
  133.                             │ Quit        │
  134.                             ╘═════════════╛
  135.  
  136. Input File
  137.  
  138. The Input File is the problem file you wish to diagnose or operate on.
  139. You must provide its name. If you do not do so from the File submenu,
  140. any Diagnose or Operation option will prompt you as if you had selected
  141. the Input File menu item.
  142.  
  143. When you select Input File (or when the program otherwise decides it
  144. needs an input file name), you will be prompted this way:
  145.  
  146.                        Input File Name: *.*
  147.  
  148. If you hit the Enter key, you will be presented with a list of all the
  149. files in the default directory. Move the cursor to the file name you
  150. want to select and hit the ENTER key.  The selected file name will
  151. appear as the response to the program's request for an input file name.
  152. You can then edit it or hit the ENTER key to accept it.  Alternatively,
  153. you can ignore the initially proposed *.* and type the name (including
  154. drive and directory, if necessary) of the file you wish to fix.  When
  155. you have finished typing and editing the file name (conventional
  156. editing keys work), hit the ENTER key.  If you include a DOS wildcard
  157. (* or ?) in the filename, you will be presented with a list of files
  158. matching the file specification, from which you can select by hitting
  159. the ENTER key.  (For details on editing the file name, hit F1 for
  160. context sensitive help.)
  161.  
  162. If you change your mind and do not wish to selecting an input file,
  163. make your response to the prompt blank and hit ENTER.
  164.  
  165. Output File
  166.  
  167. Doctor 6 does not change the input file in any way.  All changes it
  168. makes are written to an output file.  You can provide the output file
  169. name by selecting the Output File option from the File submenu.  If you
  170. do not do so, any program option requiring an output file will prompt
  171. you for the output file name.
  172.  
  173. When this option is selected (or the program needs an output file
  174. name), Doctor 6 will ask you for the name of an output file, the fixed
  175. file it is to create.  It will propose a file name, which you can
  176. accept by hitting the ENTER key.  Usually, the name it proposes will be
  177. the name (including path) of the input file, but with the extension
  178. FIX.  If a file with that name already exists, Doctor 6 will try
  179. extensions from X01 to X99.  If all of those are in use with that file
  180. name, Doctor 6 will not propose a file name.  If you like the proposal
  181. but would like to edit it a bit, move the cursor with an arrow key
  182. before doing any editing.  If you do not like the proposal and would
  183. like to enter a new name, just start typing; the proposed name will
  184. vanish.  If you would like to restore the original proposal, hit Ctrl-
  185. R.
  186.  
  187. If there are problems with the input or output file name you supply,
  188. Doctor 6 will ask you to take corrective action.  It should be obvious
  189. how to respond.
  190.  
  191. Quit
  192.  
  193. Selecting this submenu option will cause an exit from the program
  194. (although you will be asked to confirm your choice).  It usually will
  195. be more convenient to use other ways to exit.
  196.  
  197.  
  198. II.     DIAGNOSE Submenu
  199.  
  200. Selecting the Diagnose menu choice produces the following submenu, from
  201. which you can select with first letters or cursor movement with the
  202. Enter key:
  203.  
  204.                           ╒═════════════════╕
  205.                           │ Prefix Check    │
  206.                           │ Bad Code Check  │
  207.                           │ Reference Check │
  208.                           │ Undo Check      │
  209.                           ╘═════════════════╛
  210.  
  211.  
  212. Do NOT select Reference Check or Undo Check until you know there are no
  213. remaining bad codes in the document file.
  214.  
  215. Note that not every condition that Doctor 6 can fix is subject to
  216. diagnosis.  It is useful to begin by testing for problems that can be
  217. diagnosed, but when diagnosis fails, you have to experiment with cures.
  218.  
  219. Prefix Check
  220.  
  221. Prefix Check diagnoses a number of structural problems in the document
  222. prefix.  If Doctor 6 finds structural problems in the prefix, it
  223. identifies them.  Usually, the only cure is Drastic Surgery (see
  224. below).  However, if the structural problem found is only that the file
  225. is not properly identified internally as a WordPerfect 6 file, Doctor 6
  226. offers you the opportunity to change that internal identification (and,
  227. if you have not yet supplied an output file name, asks for an output
  228. file name if you do want to change the identification).  It is unlikely
  229. that an otherwise structurally sound prefix has improper
  230. identification, so you are not likely to be offered this opportunity.
  231.  
  232. Because structural prefix problems may make it impossible for Doctor 6
  233. to perform its other functions, a Prefix Check should precede any other
  234. diagnoses or operations on an input file (although it is not necessary
  235. before Drastic Surgery or Erase Selected Prefix Data).  But it is not
  236. necessary to select Prefix Check explicitly; if you fail to do so, the
  237. other program options (other than Drastic Surgery and Erase Selected
  238. Prefix Data) will do it automatically.
  239.  
  240. Bad Code Check
  241.  
  242. WPerf6 function codes are stored as series of bytes that have meaning
  243. to WPerf6, not as what you see in Reveal Codes.  If even one byte in a
  244. code is incorrect (or if there is a byte that WPerf6 thinks is part of
  245. a code even though it is not), WPerf6 can get hopelessly confused.
  246. This confusion can have dramatic results.  For example, the entire text
  247. of your document may disappear from the screen; even though the text is
  248. actually all there in the file, WPerf6 shows nothing but a blank
  249. screen.  Or you may lose part of the text, a "loop" may develop so that
  250. moving the cursor down in the document brings you to an earlier part of
  251. it, the program may lock up, or the text may become incorrect in other
  252. ways.  If you are in Windows, a GPF may occur.
  253.  
  254. Bad Code Check tests for bytes that can cause this kind of problem and
  255. reports whether there are any.  If there are bad codes, you should next
  256. choose Cure Corrupted Data from the Operate menu.
  257.  
  258. It is possible that Bad Code Check will miss certain kinds of bad
  259. codes.  If all else fails, you can run Cure Corrupted Data even though
  260. Bad Code Check found no problems.
  261.  
  262. As explained above, some document text is stored in the document
  263. prefix.  Bad Code Check usually checks for bad codes in the text stored
  264. in the document prefix.  However, in some cases it does not, because it
  265. is unable to process the "packet" storing the data.  That probably
  266. indicates that internal information about the data packet has been
  267. corrupted.  Bad Code Check reports the sequence number of the first ten
  268. unprocessed packets.  You should probably delete them using Erase 
  269. Selected Prefix Data. 
  270.  
  271. Use Bad Code Check BEFORE using Reference Check or Undo Check.  If bad
  272. codes are found, use Cure Corrupted Data BEFORE using Reference Check
  273. or Undo Check.  Corrupted data in the document file can cause problems
  274. for some Doctor 6 functions, just as corrupted data can cause problems
  275. for WPerf6.
  276.  
  277. Reference Check
  278.  
  279. Reference Check checks for invalid references to portions of the
  280. prefix.  (It cannot test for all possible invalid references, however.)
  281. Not all bad references cause problems for WordPerfect. But if there are
  282. bad references and no other obvious problems, and the file does not
  283. work, you should try using Remove Bad References on the Operate
  284. submenu.
  285.  
  286. Corrupted data in a document may lead Reference Check to give spurious
  287. results (or worse). Therefore, you should use Bad Code Check before
  288. using Reference Check, and if there are bad codes, you should Cure
  289. Corrupted Data before running Reference Check.  Like Bad Code Check,
  290. Reference Check may fail to process certain prefix data.  Unlike Bad
  291. Code Check, Reference Check does not report the unprocessed data
  292. packets (because you should use Bad Code Check before using Reference
  293. Check, so you will know about these packets).
  294.  
  295. Undo Check
  296.  
  297. If a document is created with Allow Undo selected in WPerf6, WPerf6
  298. stores deleted material in the document file so it can later undo what
  299. you did.  If the document becomes corrupted, WPerf6 could become
  300. confused about what portions of the document are valid and what
  301. portions are merely stored for later use by the undo function.  In
  302. theory, it would be possible for WPerf6 to treat valid data as data
  303. stored for use by undo.  The result would be to make valid data
  304. invisible and unusable.
  305.  
  306. It is not always possible to tell whether this has happened.  However,
  307. one way to test for the possibility is to look for what we term
  308. "unbalanced undo codes."  That is what Undo Check does. If it finds
  309. unbalanced undo codes, you should run Undo Undo from the Operate
  310. submenu.
  311.  
  312. Do NOT use Undo Check until you have run Bad Code Check and, if
  313. necessary, Cure Corrupted Data.
  314.  
  315.  
  316. III.    OPERATE Submenu
  317.  
  318.  
  319. Selecting the Operate menu choice produces the following submenu, from
  320. which you can select with first letters or cursor movement with the
  321. Enter key:
  322.  
  323.                      ╒════════════════════════════╕
  324.                      │ Cure Corrupted Data        │
  325.                      │ Remove Bad References      │
  326.                      │ Erase Selected Prefix Data │
  327.                      │ Strip Debris               │
  328.                      │ Drastic Surgery            │
  329.                      │ Undo Undo                  │
  330.                      │ Kill Pair Codes            │
  331.                      │ Fix Spurious Password      │
  332.                      ╘════════════════════════════╛
  333.  
  334. Except for minor problems in prefix structure, fixed in Check Prefix
  335. Structure on the Diagnose submenu, this submenu is where you actually
  336. fix problems in your document.
  337.  
  338. It may be necessary to use more than one method of operating to fix any
  339. particular file.  This requires some care in the management of input
  340. and output files.  For example, if you start with the input file
  341. BADFILE and Cure Corrupted Data, by default you would create
  342. BADFILE.FIX in the process.  If you also need to Remove Bad References,
  343. you would not use BADFILE as the input file for Remove Bad References.
  344. Rather, you would use BADFILE.FIX as the input file, creating (by
  345. default) BADFILE.X01 as the output file.  If you used BADFILE as the
  346. input file for both operations, you would either overwrite one output
  347. file with the other, or else create two output files, one with the
  348. corrupted data fixed, and one with the bad references fixed.  That
  349. would probably not be what you want.  Multiple operations work in
  350. sequence; each should use as its input file the output of the previous
  351. operation.
  352.  
  353.  
  354. Cure Corrupted Data
  355.  
  356. Cure Corrupted Data searches both the prefix and the body of the file
  357. for bad codes of the sort reported by Bad Code Check. Usually when it
  358. finds them, it deletes them and leaves the message **FIX** in their
  359. place.  After you retrieve the fixed file into WPerf6, search for
  360. **FIX** (use an Extended Search, because Cure Corrupted Data may have
  361. fixed a problem in a footnote, endnote, header, footer, or text box),
  362. and see if anything is missing at that point.  At least one code is
  363. likely to be missing.  In addition, you will often see garbage --
  364. erroneous characters and codes -- after the **FIX** message.  The
  365. garbage is the remains of broken codes.  Simply delete it.
  366.  
  367. In a style stored in the prefix becomes corrupted and Doctor 6 fixes
  368. it, these fixes are not reflected in the body of the document when the
  369. document is retrieved (unless the corruption is also found in teh
  370. document where the style is used).  If you edit the style, howver,
  371. these changes will be reflected in the document.
  372.  
  373. In very rare cases, Cure Corrupted Data will cure a problem without
  374. leaving a **FIX** message. This happens primarily when it figures out 
  375. exactly what the incorrect bytes should be and replaces them with the 
  376. correct ones. 
  377.  
  378. Cure Corrupted Data also removes certain unnecessary codes (unnecessary
  379. because WPerf6 will replace them automatically) without leaving a
  380. message.  These unnecessary codes can become corrupted in ways Doctor 6
  381. cannot identify.  That is why the Doctor removes them all.  Thus Cure
  382. Corrupted Data may fix problems that Bad Code Check cannot identify.
  383. You should therefore consider using Cure Corrupted Data even when Bad
  384. Code Check does not find a problem.
  385.  
  386. Like Bad Code Check, Cure Corrupted Data may fail to process certain
  387. prefix data.  Also like Bad Code Check, it reports the numbers of the
  388. data packets it fails to process, so you can, if necessary, delete them
  389. using Erase Selected Prefix Data.
  390.  
  391. Curing corrupted data may fully fix the problems in a file, but even
  392. where the problem is basically corrupted data, this single operation
  393. may not be sufficient.  After curing the corrupted data, you should at
  394. least use Bad Reference Check and Undo Check to see if there are any
  395. obvious problems (remember to change the Input File to the output of
  396. Cure Corrupted Data before doing so).  If the file passes these tests
  397. but still does not work correctly in WPerf6, try Strip Debris on the
  398. Operate submenu.  We have seen cases where a file with no remaining
  399. problems indicated by the Diagnose options nevertheless causes WPerf6
  400. to lock up, and Strip Debris sometimes fully cures the remaining
  401. problems.  Kill Pair Codes is also sometimes helpful in these
  402. situations.
  403.  
  404. Remove Bad References
  405.  
  406. Bad references to portions of the document prefix, as found by Bad
  407. Reference Check, can cause serious problems for WPerf6, although they
  408. do not necessarily do so. In principle, the best way to handle them
  409. would be to replace them by valid references to portions of the prefix.
  410. Unfortunately, when Doctor 6 finds a bad reference, it has no way of
  411. knowing what the correct reference would be.  Therefore, it has no
  412. alternative to deleting the code that contains the bad reference.  That
  413. is what Remove Bad References does.
  414.  
  415. Removing bad references causes some damage to a file.  Therefore, even
  416. if the file is known to contain bad references, you should not
  417. automatically remove them.  Try retrieving the file into WPerf6 before
  418. removing them.  If WPerf6 can handle the file, do not remove the bad
  419. references. You might also try Cure Corrupted Data, Strip Debris, and
  420. Kill Pair Codes before removing the bad references.
  421.  
  422. When Remove Bad References deletes a code in a portion of the document
  423. to which a WPerf6 user normally has access, it optionally leaves the
  424. message **BadRef** in the document.  (You are asked whether you want to
  425. mark deleted bad references when you run Remove Bad References.) When
  426. you retrieve the document, if you have used this option, do an Extended
  427. Search for **BadRef** so you can delete the messages, see if there is
  428. any remaining garbage that needs to be deleted, and attempt to replace
  429. the deleted code with a proper one.  This can be useful if there are
  430. only a few bad references.  However, if the bad references are numerous
  431. (as they certainly will be if you used Drastic Surgery), looking at the
  432. **BadRef** marks littering your document is not worth the effort.
  433.  
  434. In theory, it is possible for a pass through Remove Bad References to
  435. create some bad references in the process of removing others.  To guard
  436. against this unlikely possibility, you should do a Bad Reference Check
  437. on the Remove Bad References output file if Remove Bad References did
  438. not fully cure the file.
  439.  
  440. Removing bad references can cause other problems in a document, because
  441. the code containing the bad references may be paired with other codes;
  442. WPerf6 can get confused if one member of the pair is missing.  It may
  443. therefore be necessary to Kill Pair Codes after removing bad
  444. references.
  445.  
  446. Note that Remove Bad References, like Reference Check, may fail to
  447. process certain prefix data.
  448.  
  449. Erase Selected Prefix Data
  450.  
  451. Sometimes you can determine that a problem is caused by something in
  452. the document prefix, but Doctor 6 cannot diagnose the problem.  You
  453. can, for example, be reasonably certain that the problem has to do with
  454. the prefix if Doctor 6's Diagnose submenu finds no problem, Strip
  455. Debris and Undo Undo do not cure the problem, and Drastic Surgery
  456. produces a working file.  You could cure the problem with the least
  457. damage to your file by deleting only that piece of the prefix that is
  458. causing the problem.  Of course, you probably do not know which portion
  459. of the prefix is causing the problem, but there is always trial and
  460. error, perhaps informed by hunch.  If Bad Code Check failed to process
  461. certain prefix data packets, a reasonable hunch is that remaining
  462. problems are related to those data packets.
  463.  
  464. To allow you to fix as many prefix problems as possible, Doctor 6
  465. permits you to run Erase Selected Prefix Data even if the document
  466. prefix is structurally bad, provided that either the bytes identifying
  467. the file as a WPerf6 document file are intact (perhaps after they are
  468. fixed in Prefix Check).  This is risky, however.  Certain kinds of
  469. problems in the prefix may cause Doctor 6 to crash, just as they cause
  470. WPerf6 to crash.  Be careful.
  471.  
  472. Erase Selected Prefix Data allows you to delete selected portions of a
  473. document prefix.  When you choose this option, you are presented with a
  474. list from which you can pick the portions (or "data packets") to
  475. delete.  Here is an example of such a list:
  476.  
  477.  
  478. ╒       Size    Uses    Type══════════════════════════════════════╕
  479. │   1:       23    1 Comment/Annotation                           │
  480. │   2:        6    1 Initial Font                                 │
  481. │   3:      152    2 Style Data                                   │
  482. │   4:      264    9 Style Data                                   │
  483. │   5:      255   15 Style Data                                   │
  484. │   6:           [DELETED]                                        │
  485. │   7:     1214    1 General WP Text                              │
  486. │   8:      146    3 Style Data                                   │
  487. │   9:        6    1 Bookmark Data                                │
  488. │  10:      140   10 Style Data                                   │
  489. │  11:      154    2 Style Data                                   │
  490. │  12:      240    2 Style Data                                   │
  491. │  13:      107    8 Outline Style                                │
  492. │  14:      140    3 Style Data                                   │
  493. │  15:      212    5 Style Data                                   │
  494. │  16:       46   29 Desired Font                                 │
  495. │  17:      109    1 Outline Style                                │
  496. │  18:       61   23 Style Data                                   │
  497. │  19:       70   10 Desired Font                                 │
  498. │  20:       46    1 Desired Font                                 │
  499. │  21:       29    6 Border Line Style                            │
  500. │  22:       12    1 Document Height                              │
  501. ╘═════════════════════════════════════════════════════════   More╛
  502.  
  503.  
  504. The first column has the sequence number of the data packet.  The next
  505. column, Size, indicates the number of bytes the prefix data packet
  506. takes up.  The Uses column indicates the number of times other parts of
  507. the document call upon that data packet.  The Type column indicates the
  508. nature of the packet.  (The meaning of the types is not always obvious.
  509. It is beyond the scope of this documentation to explain each of the
  510. types.)  Any deleted packets are so indicated.  Note that if the size
  511. seems unlikely, it may be incorrect.  (Prefix Check may have shown a
  512. problem as a result of such an error.)
  513.  
  514. You select packets for deletion by moving the highlight to the desired
  515. line and hitting the Insert key (you can also use the space bar, which
  516. toggles selection).  After you have selected one or more packets, hit
  517. the Enter key to accept your selections.  (See the context sensitive
  518. help for more information on selecting from the list.)
  519.  
  520. Deleting data packets may result in bad references.  As usual, see if
  521. the file works in WPerf6 before removing the bad references.
  522.  
  523. Strip Debris
  524.  
  525. Strip Debris removes from the file material stored for the Undo
  526. function and some unnecessary formatting information (unnecessary
  527. because WPerf6 replaces it automatically).  No test is available to
  528. determine when this option is likely to fix a file.  The option should
  529. therefore be used after other methods prove insufficient, or when no
  530. other method seems indicated.  In particular, it may be helpful to
  531. Strip Debris from the output file created by Cure Corrupted Data.
  532.  
  533. Removing material stored for the undo function can be dangerous.  If
  534. the codes marking this material are incorrect, Strip Debris can delete
  535. valid text.  Undo check provides some safeguard against this
  536. possibility, but not a perfect safeguard.  If after using Strip Debris,
  537. it appears that too much text has vanished, go back to the version of
  538. the file you used as input to Strip Debris and try Undo Undo instead.
  539.  
  540. Drastic Surgery
  541.  
  542. Drastic Surgery amputates the document prefix, the beginning part of
  543. the document file you do not see in WPerf6, and replaces it with
  544. another document prefix.  This amputation loses a good deal of
  545. information, including graphics, styles, footnotes, endnotes, boxes,
  546. headers, footers, and more.  This loss is not a good thing, and
  547. therefore you should not undertake Drastic Surgery lightly.  Use it
  548. only when other approaches do not work.
  549.  
  550. In some cases, you may be able to preserve text stored in your prefix
  551. (footnotes, comments, box contents, and so forth) by using SaveText, a
  552. separate computer program described below. However, while SaveText may
  553. be able to preserve the text, the text will not be preserved as part of
  554. your document.
  555.  
  556. If the only problem is a problem in the prefix, Drastic Surgery may be
  557. all the cure you need.  But Drastic Surgery may simply allow WPerf6 to
  558. get to the rest of the document, where there could also be problems.
  559. So if Drastic Surgery does not fully cure your file, try the other
  560. approaches again, using the Drastic Surgery output as the input file.
  561. In particular, it is certain that use of Drastic Surgery will result in
  562. bad references in the body of the document.  Often these bad references
  563. will result in no problem, but if WPerf6 cannot handle the Drastic
  564. Surgery output file, you may want to remove the bad references from it.
  565. There are likely to be so many bad references that you will not want to
  566. let the Doctor mark them all in your document.
  567.  
  568. Normally, Drastic Surgery replaces the existing document prefix with a
  569. very minimal prefix containing no useful information.  However, you are
  570. given the opportunity to tell the program to use a prefix taken from
  571. another file.  If you chose this option, you supply the program with
  572. the name of another file, and Doctor 6 copies the prefix from that
  573. file.  You would do this if you think another file has a prefix
  574. identical to the one that is, or should be, in the sick file.
  575. Unfortunately, it is highly unlikely that two different files have
  576. identical, or even nearly identical, prefixes.  Even if two prefixes
  577. contain the same styles, footnotes, boxes, and so forth, the
  578. information is not likely to be in precisely the same places in the two
  579. different prefixes.  And if the information is not precisely where the
  580. body of the document expects it to be, it might as well not be there at
  581. all. Therefore, you are not likely to find this option useful.
  582.  
  583. In order to amputate the existing prefix and put a new prefix before
  584. the body of your document, Drastic Surgery needs to know the "offset,"
  585. the location, in the file where the body of your document begins (or,
  586. equivalently, where the existing prefix ends).  That information is
  587. stored very close to the beginning of a normal WordPerfect document.
  588. Of course, you would not be using Drastic Surgery if your document were
  589. a normal WordPerfect document.  Therefore, the information stored in
  590. the file where the offset of the start of the text is supposed to be
  591. stored may not be valid.  Nevertheless, that information is worth
  592. trying.
  593.  
  594. Doctor 6 reads that information.  If it thinks that the information
  595. indicates a plausible file offset, it asks you whether you want to try
  596. Drastic Surgery using that offset.  To help you decide whether to try
  597. that offset, the Doctor also tells you the number of bytes there would
  598. be in the body of your document if that were the offset of the
  599. beginning of the body.  If you think that number of bytes is at all
  600. plausible, you might as well run Drastic Surgery using that offset.  At
  601. best, it is the right offset (and in our experience it usually is the
  602. right offset).  At worst, it is wrong, the output file is not very
  603. good, and you try Drastic Surgery again.  In other words, let the
  604. Doctor try Drastic Surgery with the internally stored offset
  605. information unless you have a very good reason not to.
  606.  
  607. The usual good reason is that you have already tried that once.  There
  608. can be other good reasons. If the file you are trying to fix is a 200
  609. page document and the Doctor says that, based on the internally-stored
  610. offset, the text of the file is 500 bytes, the internally stored value
  611. is not likely to be right.
  612.  
  613. If you decide not to use the offset stored internally, you have to tell
  614. the Doctor where the body of the document begins.  So that you can do
  615. this, the Doctor displays your file in a conventional "hex mode"
  616. manner.  As an example, we use a simple file, which contains nothing
  617. but the sentence "This is an example."  The first part of the hex mode
  618. display looks like this:
  619.  
  620. ╒══════════════════════════════════════════════════════════════════════════════╕
  621. │000000   FF 57 50 43 57 04 00 00 01 0A 02 00 00 00 00 00   .WPCW...........   │
  622. │000010   02 00 17 00 00 00 00 00 00 00 00 00 00 00 00 09   ................   │
  623. │000020   01 00 00 00 06 00 00 00 52 01 00 00 08 01 01 00   ........R.......   │
  624. │000030   00 00 0C 00 00 00 6D 03 00 00 08 02 01 00 00 00   ......m.........   │
  625. │000040   10 00 00 00 79 03 00 00 08 32 01 00 00 00 0E 00   ....y....2......   │
  626. │000050   00 00 89 03 00 00 09 25 01 00 00 00 06 00 00 00   .......%........   │
  627. │000060   58 01 00 00 08 20 01 00 00 00 2F 00 00 00 5E 01   X.... ..../...^.   │
  628. │000070   00 00 08 22 01 00 00 00 7B 00 00 00 8D 01 00 00   ..."....{.......   │
  629. │000080   08 33 01 00 00 00 18 00 00 00 97 03 00 00 08 34   .3.............4   │
  630. │000090   01 00 00 00 14 00 00 00 AF 03 00 00 0B 30 02 00   ......../....0..   │
  631. │0000A0   00 00 28 00 00 00 08 02 00 00 08 23 01 00 00 00   ..(........#....   │
  632. │0000B0   0F 01 00 00 30 02 00 00 00 21 01 00 00 00 90 00   ....0....!......   │
  633. │0000C0   00 00 C3 03 00 00 09 29 01 00 00 00 04 00 00 00   ..C....)........   │
  634. │0000D0   53 04 00 00 00 00 00 00 00 00 00 00 00 00 7B 04   S.............{.   │
  635. │0000E0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................   │
  636. │0000F0   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................   │
  637. │000100   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................   │
  638. │000110   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................   │
  639. │000120   00 00 00 00 00 00 00 00 00 55 01 00 00 00 2E 00   .........U......   │
  640. │000130   00 00 3F 03 00 00 00 00 00 00 00 00 00 00 00 00   ..?.............   │
  641. │000140   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................   │
  642. ╘══════════════════════════════════════════════════════════════════════════════╛
  643.   and the end looks like this:
  644.  
  645. ╒══════════════════════════════════════════════════════════════════════════════╕
  646. │0003C0   00 00 00 00 01 FE FF 22 00 41 00 49 00 50 00 5B   .....~.".A.I.P.[   │
  647. │0003D0   00 72 00 81 00 83 00 FF FF FF FF FF FF FF FF FF   .r..............   │
  648. │0003E0   FF FF FF FF FF EF B3 88 45 3F FF FF FF FF FF FE   .....o3.E?.....~   │
  649. │0003F0   FF CC CC 03 30 B3 1C CB CF 34 CC CF FC C0 C3 FC   .LL.03.KO4LO|@C|   │
  650. │000400   0F FF 30 01 34 00 00 00 00 00 01 08 2F FF FF FF   ..0.4......./...   │
  651. │000410   FF FF FF 4E B7 FF FF E0 04 05 00 00 00 02 AB 0F   ...N7..`......+.   │
  652. │000420   FF F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00   .p..............   │
  653. │000430   00 00 00 00 F0 6D 70 CF 9F FF 89 04 40 00 00 00   ....pmpO....@...   │
  654. │000440   00 00 00 04 03 F0 32 42 50 80 40 4C 4C 20 00 00   .....p2BP.@LL ..   │
  655. │000450   00 00 00 01 00 0C 00 DD 0A 10 00 83 01 0A 00 03   .......]........   │
  656. │000460   00 02 00 21 10 00 DD DD 0B 0B 00 03 00 00 57 0B   ...!..]]......W.   │
  657. │000470   00 DD F1 02 02 00 F1 54 68 69 73 80 69 73 80 61   .]q...qThis.is.a   │
  658. │000480   6E 80 65 78 61 6D 70 6C 65 2E F1 02 03 00 F1 D4   n.example.q...qT   │
  659. │000490   25 0D 00 80 01 01 00 00 00 0D 00 D4 F1 03 03 00   %..........Tq...   │
  660. │0004A0   F1 F1 03 02 00 F1                                 qq...q             │
  661. │                                                                              │
  662. │                                                                              │
  663. │                                                                              │
  664. │                                                                              │
  665. │                                                                              │
  666. │                                                                              │
  667. ╘══════════════════════════════════════════════════════════════════════════════╛
  668.  
  669.  
  670. Most users will care only about the sixteen columns at the right of the
  671. screen, where the cursor will stay.  Those columns display the bytes in
  672. your file (including the bytes in the prefix), usually as ascii
  673. characters corresponding to what is stored in the file, although some
  674. are displayed as dots.  (Remember that WPerf6 stores spaces  as the
  675. ascii character Ç, or hex 80, decimal 128, which the Doctor displays as
  676. a dot.)  In the rest of the screen, the first column of six digit
  677. numbers has the offset, in hexadecimal, of the first byte displayed on
  678. the line -- most users will, and should, ignore this column.  The next
  679. sixteen columns of two digit numbers are the hexadecimal representation
  680. of the sixteen bytes shown on the right.  Again, most users will, and
  681. should, ignore the hexadecimal values.
  682.  
  683. You need to move around the document looking for the beginning of the
  684. text and then put the cursor on the first character in the text (in
  685. this case, the T in This).  In moving around the file, you can use
  686. conventional cursor keys, PageUp and PageDown, Home to get to the
  687. beginning of a line of sixteen characters, End to get to the end of it,
  688. CtrlPgDown to get to the end of the file, and CtrlPgUp to get to the
  689. beginning.
  690.  
  691. In addition to moving around with the cursor movement keys, you can
  692. search for text automatically.  To search for a text string, hit CtrlQ
  693. and then F.  You will be asked to enter the string.  Type it and hit
  694. the Enter key.  You will be prompted for search options.  The valid
  695. options are U, G, and B.  Enter as many of them as you want to use and
  696. hit enter.  Option U is used if you want a case insensitive search; if
  697. you do not use it, the search is case sensitive.  The other two options
  698. control the search direction.  By default, the search is from the
  699. cursor to the end of the file.  Option B results in a backward search
  700. to the beginning of the file.  Option G will search the entire file.
  701. To repeat a search, hit CtrlL.  Searching for strings has its limits; a
  702. string will be matched only if it is found in the 16 columns of a
  703. single line.  If your search string includes a blank space, remember to
  704. represent it as Ç.
  705.  
  706. You may find it convenient to set "markers" (bookmarks) in the file --
  707. candidate locations of the start of the text.  You can set up to four
  708. markers, numbers 0 through 3.  To set a marker at the cursor location,
  709. type CtrlK followed by the number of the marker.  You can jump to a
  710. marker you have previously set by typing CtrlQ followed by the number
  711. of the marker.
  712.  
  713. It is not always easy to find the beginning of the body of the
  714. document.  Document prefixes can be many thousands of bytes long, so
  715. you may have to do a lot of paging down.  And the prefix may contain
  716. information that looks like it should be part of the text.  For
  717. example, the document summary is contained in the prefix, and it may
  718. contain a copy of part of the document text.  Styles are stored in the
  719. prefix, and they may contain chunks of text.  Examine the display
  720. carefully and try to avoid treating these chunks of text as the
  721. beginning of the document.  (There is, unfortunately, another
  722. circumstance making it impossible to find the beginning of the text
  723. part of the document.  It is not always there.  If you do not see
  724. anything resembling the start of your text anywhere in the display of
  725. the file, your document is probably too badly damaged to be recovered,
  726. or else it is a "locked" -- that is, password protected -- document.
  727. The Doctor cannot fix locked documents.)
  728.  
  729. When you find the first word in the text, it may not be located at the
  730. true beginning of the body of the document.  In fact, it almost never
  731. will be, because WPerf6 almost invariably has an Initial Codes style at
  732. the beginning of the body.  And there may be additional codes you will
  733. not recognize.  For example, if the sentence in our example file had
  734. been indented with a tab, the sentence would be preceded by a string of
  735. bytes very few people would recognize as representing a tab.  Other
  736. function codes at the start of a document are also represented by
  737. unrecognizable strings of bytes.  For reasons explained below, function
  738. codes like this are not a serious problem, and you should not worry
  739. about them..
  740.  
  741. When you have decided on what to take as the beginning of the text of
  742. the document, move the cursor to it and hit the ESC key.  The Doctor
  743. will then display the offset of that location in the file as a
  744. hexadecimal number.  You can edit that number, or you can simply hit
  745. ENTER to accept it. It is difficult to imagine any circumstance in
  746. which you would want to edit that number.
  747.  
  748. The Doctor then asks you whether you want it to search backwards
  749. through the file for codes. Unless you have a very good reason for
  750. answering N(o), you should answer Y(es).  If you do, the Doctor will
  751. move backwards in the file from the offset you located, seeing if there
  752. are valid WordPerfect codes.  If there are any, the Doctor will
  753. consider them as part of the body of the document and adjust the offset
  754. accordingly.  That is why you need not worry too much about codes like
  755. tabs before the character you identify as the start of the text of the
  756. document.  (This description may make it sound as though you could
  757. simply move the cursor to the end of the file, treat that as the offset
  758. of the beginning of the text, and let the Doctor do the work of finding
  759. the beginning of the text part of the document.  Unfortunately, that
  760. will not work, for two reasons. First, the Doctor will search backwards
  761. only for about 15,000 bytes.  Second, the Doctor will stop searching
  762. backwards the first time it finds an invalid code.  Since you would not
  763. be using the Doctor if you knew the file to be in perfect shape, there
  764. is a risk that there are invalid codes.) Backward searching may go too
  765. far back, because the prefix may end with valid codes.  Extra codes
  766. included as a result should not prove very troubling.
  767.  
  768. Once you have answered the backward searching question, the Doctor
  769. processes your file. Remember that it may be necessary to use other
  770. options afterwards.
  771.  
  772. Undo Undo
  773.  
  774. Unlike Strip Debris, which attempts to remove material stored in the
  775. file only to handle the Undo function, Undo Undo removes the codes that
  776. indicate material stored to handle the Undo function. Therefore, Undo
  777. Undo can leave in the output file, as valid data, material that was
  778. supposed to have been deleted.
  779.  
  780. Why do this?  The major, if not only, reason for doing this is to
  781. handle the possibility that corruption (or another procedure) has
  782. eliminated the code marking the end of Undo material.  In that case, it
  783. is possible that WPerf6 would treat valid text as Undo material.  If
  784. that were to happen, the valid text would be part of the file, but you
  785. could not see it or use it in any way.  By turning such text back into
  786. ordinary text, Undo Undo solves that problem.  Of course, you then have
  787. the problem of getting rid of the Undo material again.
  788.  
  789. Kill Pair Codes
  790.  
  791. Many WPerf6 codes, like the codes that mark Undo material, come in
  792. pairs.  And if one member of the pair becomes damaged or lost, WPerf6
  793. can get confused.  Kill Pair Codes eliminates the problem by getting
  794. rid of all paired codes.
  795.  
  796. This is harsh medicine.  Paired codes tend to surround other things so
  797. that WPerf6 knows they are special.  For example, paired codes surround
  798. footnote numbers in the text.  The codes give those numbers their
  799. characteristic properties of referring to footnote text and changing
  800. value as you add, delete, or move footnotes.  If you remove the paired
  801. codes, the footnote numbers become ordinary numbers, fixed forever at
  802. their current values, and not linked to actual footnotes. They become
  803. simply numbers in the text.  Similar stories can be told about other
  804. types of paired codes.  In sum, Kill Pair Codes can cause havoc for
  805. your footnotes, lists, tables of contents, included subdocuments, and
  806. much else.  All these things lose their special properties and become,
  807. at best, simply ordinary text.
  808.  
  809. Why inflict such damage on a document?  Because it may be necessary in
  810. order to make the document usable at all.
  811.  
  812. Unfortunately, it may be necessary to Kill Pair Codes after removing
  813. bad references.  This is because the opening member of a pair often
  814. refers to material in the document prefix, and removing the bad
  815. reference removes the opening code in the pair.  And since removing the
  816. entire prefix of a document is likely to create many bad references,
  817. the sequence Drastic Surgery, Remove Bad References, Kill Pair Codes
  818. arises fairly often.
  819.  
  820. Fix Spurious Password 
  821.  
  822. Both WordPerfect and Doctor 6 will occasionally report that a document 
  823. file is password protected (encrypted) when in fact it is not.  This 
  824. happens when certain bytes in the file, the ones that tell WordPerfect 
  825. (and Doctor 6) that the file is password protected, are corrupted and 
  826. convey the wrong information.  Fix Spurious Password rewrites those 
  827. bytes to indicate that the file is not password protected.  This option 
  828. will NOT decrypt a file or remove password protection.  It is helpful 
  829. ONLY if the file is not actually password protected, not actually 
  830. encrypted. 
  831.  
  832.  
  833.                           Using SaveText
  834.  
  835.  
  836. Text stored in the prefix of a document may become inaccessible, either
  837. because you have used Drastic Surgery to remove the prefix, or because
  838. a code's reference to that text has become corrupted.  The loss of
  839. prefix text can be troubling, because although some prefix text is not
  840. particularly important and can easily be replaced (headers and footers,
  841. for example), other prefix text, such as footnotes and the contents of
  842. boxes, can be very important to the document.
  843.  
  844. SaveText, a companion program to Doctor 6, can sometimes preserve
  845. prefix text that would otherwise be lost.  It does this by copying text
  846. from the prefix of one WPerf6 document to the body of a new WPerf6
  847. document it creates.  If this operation is successful, you can
  848. reconstruct the original document, using text from the body of the
  849. newly-created document as appropriate. Unfortunately, SaveText cannot
  850. tell you what function the text it saves served in its original
  851. location -- it cannot tell a footnote from an equation box.  It simply
  852. labels each block of text with the sequence number of the data packet
  853. in the prefix where it was found.  (These sequence numbers are the same
  854. as the ones shown in Doctor 6's Erase Selected Prefix Data display.)
  855. Note that SaveText will not copy the text of any prefix data packet
  856. that Doctor 6 cannot process.
  857.  
  858. SaveText will not always work, and can even crash badly.  We think it
  859. would always work if it were used only on uncorrupted files.  Of
  860. course, if the file were not corrupted, you would probably have no use
  861. for SaveText.  SaveText will, however, work on many corrupted files.
  862. It performs certain checks on the file prefix to see if the document is
  863. too far gone for the program to work, but it does not perform as many
  864. checks as the Doctor's Prefix Check option.  Therefore, SaveText will
  865. attempt to process certain files that flunk the Prefix Check, but it
  866. perhaps will also crash during processing. If SaveText refuses to
  867. process the file, you may be able to force processing by using the
  868. prefix-repairing capability of Prefix Check before running SaveText.
  869.  
  870. The output file SaveText creates may itself be corrupt, because it may
  871. include text from the prefix that itself was corrupt or because the
  872. saved text include references to material in the old prefix that is not
  873. found in the prefix of the new output file (since the prefix of the
  874. output file contains, for all practical purposes, nothing).  Doctor 6
  875. should be able to fix such an output file.
  876.  
  877. SaveText is not interactive.  You run it entirely from the DOS command
  878. line:
  879.  
  880.    C:\DR6>SaveText Infile Outfile
  881.  
  882.    Infile is the name (with drive and path, if necessary) of the file
  883.      whose prefix text you wish to save.
  884.  
  885.    Outfile is the name (with drive and path, if necessary) of the file
  886.      in which SaveText will write the Infile prefix text.  If Outfile
  887.      already exists, it will be overwritten.
  888.  
  889.  
  890.  
  891.                              Using TestSix
  892.  
  893.  
  894. TestSix is a DOS command-line program that performs the same diagnostic 
  895. functions as Doctor 6.  Although some users may find TestSix a more 
  896. convenient way to test a single file than Doctor 6, the primary reason 
  897. for using TestSix is to check large numbers of files for corruption.  
  898. TestSix is much faster than Doctor 6 for checking multiple files, 
  899. because it can process wildcard file specifications, and even entire 
  900. disks at a single pass.  Moreover, it reports its results with at most 
  901. a single line of output per file tested. 
  902.  
  903. Results are indicated by a two-letter code, followed by the full path 
  904. specification of the file tested.  For example, 
  905.  
  906.          OK K:\TEST\BOOK\PART-Z.WPD
  907.  
  908. indicates that file PART-Z.WPD in subdirectory test\book on drive K 
  909. successfully passed every diagnostic test.  ("OK" does not mean that 
  910. the file is not corrupt, because some forms of corruption are not found 
  911. by the diagnostic tests.) 
  912.  
  913. In addition to OK, the two-letter codes and their meanings are as 
  914. follows: 
  915.  
  916.          NF      File not found
  917.          NP      No prefix (fewer than 16 bytes in the file)
  918.          5X      A WordPerfect 5.x document file
  919.          N6      Not a WordPerfect 6.x document file
  920.          EN      Encrypted (password protected) WPerf6 document
  921.          BS      Bad starting point for document body indicated
  922.          NI      No indexes found in prefix
  923.          PL      Data packet length indicated is invalid
  924.          OP      Overlapping data packets indicated
  925.          PO      Data packets overlap document body
  926.          BC      Bad codes found
  927.          BR      Bad references found
  928.          UU      Unbalanced undo codes found
  929.  
  930. Note that a file may have more than one form of corruption.  TestSix, 
  931. however, reports only the first form found. 
  932.  
  933. If you are testing large numbers of files, the default output may be 
  934. more voluminous than is convenient.  For example, if you are testing 
  935. 1,000 WordPerfect 6 document files, and three of these fail a 
  936. diagnostic test, you will have 997 lines of output listing files that 
  937. are "OK."  As indicated below, options allow you to restrict the output 
  938. to that which is likely to be interesting and useful. 
  939.  
  940. TestSix is invoked from the DOS command line this way
  941.  
  942.          c:\dr6\>TESTSIX Infile [Infile .. Infile] [options]
  943.  
  944.          Infile is a file specification, which normally would include 
  945.          the full path specification of the file(s) to be tested, and 
  946.          which may, and usually will, include wildcards (* or ?).  
  947.          TESTSIX will test every file matching the wildcard 
  948.          specification. 
  949.  
  950.          -- At least one Infile must appear on the command line, but 
  951.          you may include as many as five. 
  952.  
  953.          -- You may also use an "indirect" specification of files to be 
  954.          tested.  If an Infile on the command line is preceded by @ 
  955.          (e.g., @c:\wp60\flist), the file is not a file for TestSix to 
  956.          test, but instead an ASCII text file containing a list of 
  957.          Infiles, one per line. (If you want to use TestSix on a WPerf6 
  958.          file whose name begins with @, you must either specify that 
  959.          file in an indirect file rather than on the command line, or 
  960.          else include the path, e.g., c:\wp60\@flist as an infile tests 
  961.          the file @flist, found in the c:\wp60 subdirectory). 
  962.  
  963.          Output goes to standard output (by default the screen), and 
  964.          normally should be piped or redirected. 
  965.  
  966.          Options
  967.  
  968.          Each option is specified by - or / preceding a single letter, 
  969.          e.g., -E or /E.  If you use two options, you can specify them 
  970.          separately (e.g., -E -O) or combine them (e.g., -EO).  There 
  971.          is never any reason to use more than two options, since all 
  972.          the options other than E are mutually exclusive. 
  973.  
  974.          -E      Any wildcard Infile is processed not only in the 
  975.                  indicated subdirectory, but also in every subdirectory 
  976.                  hierarchically below that subdirectory in the 
  977.                  directory tree.  Thus, for example, c:\*.*, if used 
  978.                  with the -E option, would process every file on drive 
  979.                  c. 
  980.  
  981.          -F      Output includes a line for every file processed.  This 
  982.                  is the default option, and there is never any need to 
  983.                  specify it (but it is not an error if you do). 
  984.  
  985.          -O      Output includes a line for each file with the code OK, 
  986.                  and for no other files. 
  987.  
  988.          -B      Output includes a line for each file found to be 
  989.                  corrupted (bad), and for no other files. 
  990.  
  991.          -N      Output includes a line for each file that does not 
  992.                  receive the code OK. 
  993.  
  994.          The difference between -B and -N may be obvious, but in case 
  995.          it is not, note that files with the codes NF, NP, 5X, N6 or EN 
  996.          would be reported by the -N option but not the -B option, 
  997.          because although they were not found to be OK, they were also 
  998.          not found to be corrupted WordPerfect 6 files -- they were not 
  999.          found at all, were not found to be WordPerfect 6 files, or 
  1000.          were found to be encrypted so they could not be further 
  1001.          tested. 
  1002.  
  1003. Examples
  1004.  
  1005.          >TestSix c:\wpdocs\*.* -B >c:\admin\badstuff.txt
  1006.  
  1007.          Tests every file in subdirectory wpdocs, reports only those 
  1008.          files found to be corrupted, and writes the report to file 
  1009.          badstuff.txt in subdirectory admin of drive c:. 
  1010.  
  1011.          >TestSix c:\wpdocs\*.mem -EN |list /s
  1012.  
  1013.          Tests every file with the extension mem in subdirectory wpdocs 
  1014.          of drive c: and every such file in subdirectories under 
  1015.          wpdocs, reports only those files found not to be OK, and pipes 
  1016.          the results to Vern Burg's LIST program. 
  1017.  
  1018.          >TestSix @c:\myfiles\test.em >prn
  1019.  
  1020.          Tests every file matching a file specification found in ascii 
  1021.          text file c:\myfiles\test.em, reports on all such files, and 
  1022.          sends the report to the printer.  File test.em might look 
  1023.          something like this: 
  1024.  
  1025. c:\wpdocs\memos\*.*
  1026. c:\wpdocs\letters\*.95
  1027. d:\misc\*.*
  1028.  
  1029.          Using Test6
  1030.  
  1031. Test6.dll provides exactly the same diagnostic capabilities as TestSix, 
  1032. in the form of functions you can call from WordPerfect for Windows 
  1033. macros or from programs written in any language capable of calling 
  1034. functions in a DLL.  You could, for example, write a macro that 
  1035. retrieves a file only if the file tests out as not corrupted.  This 
  1036. documentation assumes you know how to call functions in DLLs.  The 
  1037. functions are documented here primarily as Pascal function headers, 
  1038. with a little explanation for the benefit of C programmers and with 
  1039. examples of how to call the functions from WPerf6.1/Win macros. 
  1040.  
  1041. The easy way to use Test6 is to use the function TestAFile, which does 
  1042. all of the TestSix testing on a single specified file (wildcards will 
  1043. NOT work).  Here is the function header: 
  1044.  
  1045. Function TestAFile(TheFileName:pchar):word;
  1046.  
  1047.          "pchar" identifies TheFileName as a pointer to a null-
  1048.          terminated string.  The function returns a word-sized number.  
  1049.          The numbers correspond to the two-letter codes displayed by 
  1050.          TestSix: 
  1051.  
  1052.          0       OK
  1053.          10      File not found
  1054.          1       No prefix (fewer than 16 bytes in the file)
  1055.          9       A WordPerfect 5.x document file
  1056.          2       Not a WordPerfect 6.x document file
  1057.          3       Encrypted (password protected) WPerf6 document
  1058.          4       Bad starting point for document body indicated
  1059.          5       No indexes found in prefix
  1060.          6       Data packet length indicated is invalid
  1061.          7       Overlapping data packets indicated
  1062.          8       Data packets overlap document body
  1063.          11      Bad codes found
  1064.          12      Bad references found
  1065.          13      Unbalanced undo codes found
  1066.  
  1067.  
  1068. Here is a sample macro using the function:
  1069.  
  1070. APPLICATION(A1; "WordPerfect"; Default; "US")
  1071. DLLLOAD (htest; "D:\DR6\test6.Dll")
  1072. TheFile := "K:\test\aussie\filing.b"
  1073. DLLCALL(htest;"TestAFile";wResult:WORD; {TheFile});
  1074. MessageBox(RetVal;"The Result Is";wResult;)
  1075. DLLFREE(htest)
  1076. QUIT
  1077.  
  1078. The hard way is to use one function call to open the file, then one 
  1079. function call for each of the tests you want to perform, and finally 
  1080. another function call to close the file and otherwise clean up.  If you 
  1081. choose the hard way (which in some situations might be slightly faster 
  1082. in execution), it is your responsibility to see that the tests you 
  1083. perform make sense.  If, for example, the file is encrypted, or has no 
  1084. prefix, it does not make sense to test whether there are bad codes in 
  1085. the body of the document.  The effect of running a senseless test may 
  1086. be unpredictable; you do NOT want to try it. 
  1087.  
  1088. If you are doing it the hard way, you MUST begin with a call to 
  1089. OpenTheFile.  It returns a word- sized boolean value, which you can 
  1090. simply treat as a word that has the value 0 for false and 1 for true. 
  1091.  
  1092. function OpenTheFile(TheFileName:pchar):WordBool;
  1093.  
  1094.          The function returns True (1) if it successfully opens the 
  1095.          file, and False (0) otherwise. 
  1096.  
  1097. If you have opened the file, you MUST close it, and perform other 
  1098. cleanup operations, when you are finished testing, and before you test 
  1099. a second file.  Therefore, the hard way (with respect to any particular 
  1100. file) ends with a call to CloseTheFile: 
  1101.  
  1102. function CloseTheFile:WordBool;
  1103.  
  1104.          CloseTheFile returns word-sized boolean value, but you should 
  1105.          ignore it. 
  1106.  
  1107. If you have successfully opened the file, you can run some tests on it.  
  1108. The first battery of tests you should run checks the file prefix and 
  1109. returns a word-sized number: 
  1110.  
  1111. function CheckThePrefix:word;
  1112.  
  1113.          Note that no file is specified; the tests are performed on the 
  1114.          file previously opened by OpenTheFile.  Do NOT call 
  1115.          CheckThePrefix if no file has been opened by OpenTheFile. 
  1116.  
  1117.          The function returns a number from 0 to 9.  The numbers 1-9 
  1118.          correspond to the same numbers as returned by TestAFile.  Zero 
  1119.          has a different meaning; it means only that CheckThePrefix 
  1120.          found no problem. 
  1121.  
  1122. If CheckThePrefix returns zero, but not otherwise, you might want to 
  1123. perform other tests as well.  There are three: 
  1124.  
  1125. function CheckTheCodes:WordBool;
  1126. function CheckTheReferences:WordBool;
  1127. function CheckTheUndo:WordBool;
  1128.  
  1129.          In each case, the function performs a test which should be 
  1130.          obvious is you have read the rest of this documentation.  The 
  1131.          result is True if the function finds a problem, and False 
  1132.          otherwise (which may be the reverse of what makes sense to 
  1133.          you). 
  1134.  
  1135. The example below checks the prefix and then the codes for a single 
  1136. file: 
  1137.  
  1138. The example below checks the prefix and then the codes for a single 
  1139. file: 
  1140.  
  1141. APPLICATION(A1; "WordPerfect"; Default; "US")
  1142. DLLLOAD (htest; "D:\DR6\test6.Dll")
  1143. TheFile := "K:\test\aussie\filing"
  1144. DLLCALL(htest;"OpenTheFile";wResult:WORD; {TheFile})
  1145. IF (wresult) 
  1146.       DLLCALL(htest; "CheckThePrefix";wResult:WORD;{})
  1147.       MessageBox(RetVal;"The Prefix Result Is";wResult;)
  1148. ELSE
  1149.       MessageBox(RetVal;"Problems Opening This File";TheFile)
  1150.       DLLCALL(htest; "CloseTheFile";wResult:WORD;{})
  1151.       DLLFREE(htest)
  1152.       Quit
  1153. ENDIF
  1154. IF (wresult = 0)
  1155.       DLLCALL(htest; "CheckTheCodes";wResult:WORD;{})
  1156.       IF (wResult)
  1157.          MessageBox(RetVal;"Bad Codes in ";TheFile)
  1158.       ENDIF
  1159. ENDIF
  1160. DLLCALL(htest; "CloseTheFile";wResult:WORD;{})
  1161. DLLFREE(htest)
  1162. QUIT
  1163.  
  1164.  
  1165. Modifications of this macro to use CheckTheReferences and/or 
  1166. CheckTheUndo should be obvious.
  1167.  
  1168.  
  1169.                               Getting Help
  1170.  
  1171.  
  1172. Help in using Doctor 6 and SaveText is available by mail, telephone,
  1173. and E-mail.  The best time for telephone calls is weekdays 8pm-11pm 
  1174. Eastern time.  At other hours, you are likely to reach only an 
  1175. answering machine.  E-mail and fax are recommended. 
  1176.  
  1177. David Seidman
  1178. Software by Seidman
  1179. 2737 Devonshire Pl. NW
  1180. Washington, DC 20008
  1181. 202/462-7381
  1182. FAX: 202/462-8601
  1183. CompuServe: [70441,2414]
  1184. Internet:    70441.2414@Compuserve.com
  1185.              seidmand@ase.com
  1186.  
  1187.                           License Information
  1188.  
  1189.  
  1190. Doctor 6 is not in the public domain.  It is fully protected by 
  1191. copyright. 
  1192.  
  1193. For purposes of evaluation and testing only, Doctor 6 is distributed as
  1194. shareware, along with the documentation in ASCII format only (but
  1195. without SaveText, TestSix, and Test6, the "associated utilities").  
  1196. Anyone receiving the shareware distribution is granted without charge a 
  1197. license which permits (a) use of the program for a reasonable period of 
  1198. time for evaluation and testing; (b) making copies for distribution to 
  1199. others without charge, provided the program and the accompanying 
  1200. documentation are distributed together and without modification; (c) 
  1201. posting the program, together with the accompanying documentation, on 
  1202. electronic bulletin board systems.  A reasonable period of time is two 
  1203. weeks following successful use of Doctor 6 to repair a file. The 
  1204. permissions granted in this paragraph do NOT apply to the associated 
  1205. utilities or to the documentation in WordPerfect format. 
  1206.  
  1207. Use after the evaluation and testing period requires payment of a
  1208. license fee (sometimes referred to as a registration fee).  For a
  1209. single copy (plus necessary archival copies), to be used on only one
  1210. computer at a time, the fee is $35.00.  For large quantities, discounts
  1211. and site licenses are available.  Write for information.
  1212.  
  1213. When you pay the registration (license) fee, we will send you the 
  1214. latest version of Doctor 6 and the associated utilities, as well as 
  1215. documentation in WordPerfect format.  Any license for which payment is 
  1216. properly made is valid for this version of Doctor 6 and the associated 
  1217. utilities and all subsequent minor version changes.  For major version 
  1218. changes (the major version is indicated by the number to the left of 
  1219. the decimal point -- this version is 2.0, and the next major version 
  1220. would be 3.0), we reserve the right to charge a license upgrade fee, 
  1221. but we may or may not require such a fee for major version upgrades. 
  1222.  
  1223. The license permits you to use Doctor 6 and the associated utilities on 
  1224. one computer at a time (and to make archival copies).  It also permits 
  1225. you to make as many copies of the documentation as you need for your 
  1226. own use.  We will attempt to send you notification of new versions.  
  1227. And if you let us know about any problems you have with the programs, 
  1228. we will try to solve them. 
  1229.  
  1230. The United States Department of Justice is granted a license, without
  1231. payment of fee, for all official use of Doctor 6 and the associated 
  1232. utilities.
  1233.  
  1234.                           Warranty Information
  1235.  
  1236.  
  1237. These programs are distributed without warranties of any kind, express
  1238. or implied, including, but not limited to, the implied warranties of
  1239. merchantability and fitness for a particular purpose.
  1240.  
  1241. No representation or other affirmation of fact, including but not
  1242. limited to statements regarding suitability for use, or performance of
  1243. the programs, shall be or be deemed a warranty by the licensor for any
  1244. purpose, nor give rise to any liability or obligation of the licensor
  1245. whatever.
  1246.  
  1247. In particular, no statement in program documentation shall be deemed a
  1248. representation or warranty that the programs will perform in any
  1249. particular manner, or perform in any manner whatsoever, or that the
  1250. programs are suitable for any particular use or any use at all.
  1251. ************************************************************************
  1252.  
  1253.                                 INVOICE
  1254.  
  1255.  
  1256. David Seidman
  1257. Software by Seidman
  1258. 2737 Devonshire Place, N. W.
  1259. Washington, D. C. 20008
  1260.  
  1261.                                               DATE:
  1262.  
  1263. SOLD TO:
  1264.  
  1265. __________________________
  1266. __________________________
  1267. __________________________
  1268.  
  1269.  
  1270. ┌───────────────────────────────────┬──────┬────────────────────────┐
  1271. │ Description                       │ Qty. │     Price              │
  1272. │                                   │      │                        │
  1273. ├───────────────────────────────────┼──────┼────────────────────────┤
  1274. │                                   │      │                        │
  1275. │ Licensed copy of Doctor6 @US$35.00│      │      $_____.__         │
  1276. │                                   │      │                        │
  1277. │ Licensed copy of Doctor 6 for     │      │                        │
  1278. │  registered user of WPMD          │      │                        │
  1279. │                        @US$25.00  │      │       _____.__         │
  1280. │                                   │      │                        │
  1281. │                                   │      │                        │
  1282. └───────────────────────────────────┴──────┴────────────────────────┘
  1283.  
  1284.                                 Total:                $_____.__
  1285.  D.C. Residents add D.C. Sales Tax (5.75%)               ___.__
  1286.  
  1287.                                 Total Charge:         $_____.__
  1288.  
  1289.  
  1290. Make checks payable to Software by Seidman.  Please mark checks
  1291. "Doctor 6".
  1292.  
  1293. For Credit Card orders, Circle one:   VISA   MasterCard  Diners Club
  1294.  
  1295. Card Number:     __________________________  Exp. Date: _____________
  1296.  
  1297. Name on card:    __________________________________________________
  1298.  
  1299. Signature:       __________________________________________________
  1300.  
  1301.  
  1302.